package hsp.admin.app.literature.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import hsp.admin.app.literature.aop.UpCountDelete;
import hsp.admin.app.literature.enums.LiteratureType;
import hsp.admin.app.literature.mapper.SayingMapper;
import hsp.admin.app.literature.po.SayingPO;
import hsp.admin.app.literature.service.ISayingService;
import hsp.admin.app.literature.vo.SayingVO;
import org.springframework.stereotype.Service;

import java.io.Serializable;

@Service
public class SayingServiceImpl extends ServiceImpl<SayingMapper, SayingPO> implements ISayingService {

    private final SayingMapper mapper;

    public SayingServiceImpl(
        SayingMapper mapper
    ){
        this.mapper = mapper;
    }

    @Override
    public Page<SayingVO> pageVO(Page<SayingVO> page, SayingPO po) {
        return mapper.selectPageVO(page, po);
    }

    @Override
    @UpCountDelete(LiteratureType.Saying)
    public boolean removeById(Serializable id) {
        return super.removeById(id);
    }

}
